package com.xc.h05.service.wutao.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.xc.h05.entity.Consultlevel;
import com.xc.h05.mapper.Consultlevel2Mapper;
import com.xc.h05.service.wutao.ConsultLevelService2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class ConsultLevelService2Impl implements ConsultLevelService2 {
    @Autowired
    private Consultlevel2Mapper consultlevelMapper;


    @Override
    public int add(Consultlevel consultlevel) {
        int add = consultlevelMapper.add(consultlevel);
        return add;
    }

    @Override
    public int delete(Long id) {
        int delete = consultlevelMapper.delete(id);
        return delete;
    }

    @Override
    public int update(Consultlevel consultlevel) {
        int update = consultlevelMapper.update(consultlevel);
        return update;
    }

    @Override
    public List<Consultlevel> findAll() {
        List<Consultlevel> list = consultlevelMapper.findAll();
        return list;
    }

    @Override
    public PageInfo<Consultlevel> findByPage(int pageNum, int pageSize, Consultlevel consultlevel) {
        PageHelper.startPage(pageNum,pageSize);
        List<Consultlevel> list = consultlevelMapper.findByPage(consultlevel);
        PageInfo<Consultlevel> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }

    @Override
    public int deletelevelByIds(List<Long> ids2) {
        int i = consultlevelMapper.deletelevelByIds(ids2);
        return i;
    }
@Override
    public Consultlevel findById(Integer id) {
        Consultlevel consultlevel = consultlevelMapper.findById(id);
        return consultlevel;
    }
}
